package com.example.data_structures;

public class MaxNum {
    public static void main(String[] args) {
        int[] nums={2,3,1,4,5,8,6};
        for (int i=0;i<nums.length-1;i++){
            for (int j=0;j<nums.length-i-1;j++){
                if (nums[j]>nums[j+1]){
                    int temp=nums[j];
                    nums[j]=nums[j+1];
                    nums[j+1]=temp;
                }
            }
        }
        System.out.println("最大的数为："+nums[nums.length-1]);
    }
}
